import pygame
from settings_manager import *

path = "data/textures/"

class LevelResources:
	@staticmethod
	def init():
		LevelResources.pImages = []
		LevelResources.pImages.append(dict())
		LevelResources.pImages.append(dict())

		for i in xrange(2):
			for direction in ["up", "down", "left", "right"]:#, "idle"]:
				LevelResources.pImages[i][direction] = []
				for index in xrange(5):
					LevelResources.pImages[i][direction].append(pygame.image.load(
						path + 
						str(SettingsManager.settings.resolution[0]) + 
						"_player" + str(i) + "_" + direction + str(index) + ".png"))

		LevelResources.burnImages = []
		LevelResources.burnImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_burn1.png"))
		LevelResources.burnImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_burn2.png"))
		LevelResources.burnImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_burn3.png"))
		
		LevelResources.expImages = []
		LevelResources.expImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_exp1.png"))
		LevelResources.expImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_exp2.png"))
		LevelResources.expImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_exp3.png"))
		
		LevelResources.bImages = []
		LevelResources.bImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bomb1.png"))
		LevelResources.bImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bomb2.png"))
		LevelResources.bImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bomb3.png"))
		LevelResources.bImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bomb4.png"))
		
		LevelResources.bExpImages = []
		LevelResources.bExpImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bombexp0.png"))
		LevelResources.bExpImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bombexp1.png"))
		LevelResources.bExpImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bombexp2.png"))
		LevelResources.bExpImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bombexp3.png"))
		LevelResources.bExpImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bombexp4.png"))
		LevelResources.bExpImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_bombexp5.png"))

		
		LevelResources.burnDelays = [250, 250, 300]
		LevelResources.expDelays = [250, 250, 300]
		LevelResources.bDelays = [100, 100, 100, 100]
		LevelResources.pDelays = [70, 70, 70, 70, 70]
		LevelResources.bExpDelays = [100, 100, 100, 100, 100, 100]
		
	@staticmethod
	def loadLevelResources(level):
		level = str(level)
		LevelResources.background = pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_level" + level + "_background.png")

		LevelResources.obImages = []
		LevelResources.obImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_level" + level + "_tree.png"))#	1
		LevelResources.obImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_level" + level + "_house1.png"))#	2
		LevelResources.obImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_level" + level + "_house2.png"))#	3
		LevelResources.obImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_level" + level + "_house3.png"))#	4
		LevelResources.obImages.append(pygame.image.load(path + str(SettingsManager.settings.resolution[0]) + "_level" + level + "_wall.png"))#	5
